// dlg.txt

//mark_quest_dest(zone,x,y,layer,quest);
//	code =
//		sf(,,2);
//		toggle_quest(19,10);
//		award_party_xp(MED_QUEST_XP);
//	break;

begintalkscript;

variables;

short this_town = 24;

begintalknode;
	tag = 1;
	condition = get_sdf(this_town,1) == 0;
	text1 = "You emerge from the winding mountain path and find yourself at the upper northern lip of a secluded vale. It is stunningly beautiful. A mountain stream enters from the north and fills a lake in the center of the valley.";
	text2 = "There are stands of trees and fields of wildflowers throughout. Unafraid game runs among the flora. There are long paths and multiple campgrounds. The people of the Kranas must come here from all over, to enjoy the beauty and feel the magic of this forest.";
	text3 = "And yet, unsurprisingly, something has gone wrong. The camps are empty. The paths are neglected. Nobody walks the paths. There is a tension in the air, a hostile energy. It's strong. You don't need any special training to detect it.";
	text4 = "Another of the sacred groves of the Kranas has fallen victim to the rage of the forest.";
	code =
		sf(this_town,1,1);
	break;
	
begintalknode;
	tag = 2;
	condition = get_sdf(this_town,2) == 0;
	text1 = "This is the final grove of the vale, reserved only for druids and the most honored people of the province. It has been thoroughly corrupted.";
	text2 = "Most of the plants have died, and the dirt has blown away. Most of the land ahead is now dead rock.";
	text3 = "At the far end, huddled against the base of the stone cliff, you can see a huge, enchanted tree. No doubt, this is the core of the magic here. Something is wrong with it.";
	text4 = "It is warped, twisted, browning, turned in on itself. Something has gone wrong with it, though you can't tell what from a distance. You might be able to see more if you got close, though it's likely to lash out at you.";
	code =
		sf(this_town,2,1);
	break;

begintalknode;
	tag = 3;
	condition = get_sdf(this_town,3) == 0 && gf(30,17) == 2;
	text1 = "You find a huge, old stump. This was once one of the grand, enchanted trees of the grove. It died, but this enormous, grand pillar of wood remains.";
	text2 = "Remembering the request you received in the Tower of the Erudico, you examine the stump closely, looking for a remaining trickle of fresh sap.";
	text3 = "Alas, this stump is too old. It's completely dry.";
	text4 = "You are in luck. You pull off a bit of bark, and a tiny trickle of sap slowly runs out. The grove immediately fills with a powerful, piney smell. You collect the sap.";
	code =
		sf(this_town,3,1);
		inc_flag(18,13,1);
		if (gf(18,13) != 3)
			rs(4);
			else {
				rs(3);
				set_spec_item(18,1);
				}
	break;

begintalknode;
	tag = 4;
	condition = get_sdf(this_town,4) == 0;
	text1 = "You are finally able to cross to this little plot of land. Your reward, alas, is an assault. The vibrations from your footsteps attract blobs of slime that were lurking under the water.";
	code =
		activate_hidden_group(10);
		add_ability(30010,10,67,0);
		sf(this_town,4,1);
	break;

begintalknode;
	tag = 5;
	condition = get_sdf(this_town,5) == 0;
	text1 = "__";
	code =
		sf(this_town,5,1);
	break;

begintalknode;
	tag = 6;
	condition = get_sdf(this_town,6) == 0;
	text1 = "__";
	code =
		sf(this_town,6,1);
	break;

begintalknode;
	tag = 7;
	condition = get_sdf(this_town,7) == 0;
	text1 = "__";
	code =
		sf(this_town,7,1);
	break;

begintalknode;
	tag = 8;
	condition = get_sdf(this_town,8) == 0;
	text1 = "__";
	code =
		sf(this_town,8,1);
	break;

begintalknode;
	tag = 9;
	condition = get_sdf(this_town,9) == 0;
	text1 = "__";
	code =
		sf(this_town,9,1);
	break;

begintalknode;
	tag = 10;
	condition = get_sdf(this_town,10) == 0;
	text1 = "__";
	code =
		sf(this_town,10,1);
	break;

begintalknode;
	tag = 11;
	condition = get_sdf(this_town,11) == 0;
	text1 = "__";
	code =
		sf(this_town,11,1);
	break;

begintalknode;
	tag = 12;
	condition = get_sdf(this_town,12) == 0;
	text1 = "__";
	code =
		sf(this_town,12,1);
	break;

// MIXED

begintalknode;
	tag = 13;
	condition = gf(24,11) == 0 && get_terrain(0,30,20) == 0;
	text1 = "The ground shakes under your feet. Roots shoot out of the ground ahead of you, blocking the path ahead.";
	code =
		set_terrain(0,30,20,118);
		set_terrain(0,30,21,118);
	break;
	
begintalknode;
	tag = 14;
	condition = gf(24,11) == 0 && get_terrain(0,51,34) != 0;
	text1 = "The stream near you starts to bubble. Huge waves splash upward. Some of them head toward you, trying to throw you off your feet. It's a lot of water.";
	text2 = "You back away to safety. The water mostly calms down, but the waves are blocking part of the bridge.";
	code =
		set_terrain(0,51,34,0);
	break;

begintalknode;
	tag = 15;
	condition = gf(24,11) == 0 && get_terrain(0,19,53) != 0;
	text1 = "The stream near you starts to bubble. Huge waves splash upward. Some of them head toward you, trying to throw you off your feet. It's a lot of water.";
	text2 = "You back away to safety. The water mostly calms down, but the waves are blocking part of the bridge.";
	code =
		set_terrain(0,19,53,0);
	break;

begintalknode;
	tag = 16;
	condition = 1;
	text1 = "Your blows have torn into the floral monstrosity. It stops moving and starts to shudder. Then it rips open!";
	text2 = "Several creatures crawl out of the wreckage. These were the wildlife of the path, until the monster swallowed and corrupted them. Then the remnants of the corpse start to spray out foul gasses.";
	text3 = "It is dying, but it will sicken everyone nearby before it is finally still.";

begintalknode;
	tag = 17;
	condition = 1;
	text1 = "At last, one of the horrifying stinkflowers finally dies. The air around it begins to clear.";

begintalknode;
	tag = 18;
	condition = 1;
	text1 = "The thorny, brown vines of the corrupted plant twist around, tangling around each other. The diseased beast lets out a deep, alien moan.";
	text2 = "It is just lashing out at you mindlessly. You try to figure out what is wrong with it, but you aren't close enough.";

begintalknode;
	tag = 19;
	condition = 1;
	text1 = "The thorny, brown vines of the corrupted plant twist around, tangling around each other. The diseased beast lets out a deep, alien moan.";
	text2 = "It is just lashing out at you mindlessly. You try to see what is wrong with it. You are close enough to see between the vines, but you don't see anything amiss. Not that you can tell what you are looking at.";

begintalknode;
	tag = 20;
	condition = 1;
	text1 = "You get closer and look between a different group of vines. You see the woody trunk of the beast, but nothing else. Meanwhile, it keeps lunging at you.";

begintalknode;
	tag = 21;
	condition = 1;
	text1 = "You duck around the flailing tree to the side, trying to get a close look at another section of it. Your blows knock some of the vines aside, but you don't see anything but more trunk and vines.";

begintalknode;
	tag = 22;
	condition = 1;
	text1 = "With a final blow, you chop down the evil tree. It collapses to the group with a final, shrill, alien moan. A mighty victory.";
	text2 = "The Kranas will be angry, of course, but it is their fault for worshipping such a mindless, dangerous beast.";
	text3 = "You search the area for treasure. You find some amber in the dirt around the beast's base, along with a potion flask, a crystal orb, and other offerings. In addition, you recover the blade buried in its trunk.";

begintalknode;
	tag = 23;
	condition = 1;
	text1 = "The tree is still calm. It is healing, and so is the grove. Its thorny vines form a thick shell around it, keeping it safe from future attacks.";
	text2 = "The air is full of sweet pollen. You take a moment to enjoy some well-deserved peace and tranquility.";

begintalknode;
	tag = 24;
	condition = 1;
	text1 = "__";

begintalknode;
	tag = 25;
	condition = 1;
	text1 = "__";

//// Proserpexa

begintalknode;
	tag = 30;
	state = -1;
	nextstate = 10;
	condition = 1;
	question = "Name";
	text1 = "One woman has not abandoned the Vale of Tranquility. She is small and very old, but she stands upright, unafraid of the magic here. She has long silver hair and light armor. Yet, you see no weapon. Her command of nature protects her.";
	text2 = "When you get close, she must be able to hear you. Yet, she says nothing. She only looks out over the grove. Occasionally, she sighs and shakes her head.";
	text5 = "Proserpexa looks out over the vale. She only talks when spoken to, and then only as a whisper. She is listening to something you can't hear.";
	action = INTRO;

begintalknode;
	state = 10;
	nextstate = 20;
	condition = gf(24,14) == 0;
	question = "_Greetings, druid._";
	text1 = "When she responds, it is a whisper. You feel compelled to match her low volume. She says, _Greetings. I am Proserpexa. I watch the woods._";
	code =
		sf(24,14,1);
	break;

begintalknode;
	state = 10;
	nextstate = 20;
	condition = gf(24,14) == 0;
	question = "_What are you looking at?_";
	text1 = "_The Tranquility Path. I am here because it is damaged, and it must be helped._";
	text2 = "_I know why you are here._";
	code =
		sf(24,14,1);
	break;

begintalknode;
	state = 10;
	nextstate = 20;
	condition = gf(24,14) == 0;
	question = "_I am [P] [N] of Haven._";
	text1 = "_I've heard of you. Mighty ruler of Empire, sent to use force to put nature to rights._";
	text2 = "_I know why you are here._";
	code =
		sf(24,14,1);
	break;

begintalknode;
	state = 20;
	nextstate = 10;
	condition = 1;
	question = "_Why am I here?_";
	text1 = "_I know you were sent to aid the groves. You have even succeeded. You don't burn, like so many of Haven. Therefore, I have no choice but to trust you._";
	text3 = "_I know you were sent to aid the groves. I know you have brought fire and destruction. I can't trust you. Still, I can't stop you._";
	action = DEP_ON_SDF 23 15 0;
	
begintalknode;
	state = 10;
	nextstate = 11;
	condition = gf(24,14) > 0;
	question = "_Tell me about the Path._";
	text1 = "_This is a sacred place of the Kranas. A treasure shared by all. Nature here is wild, harsh, and demanding. Yet, the Path ... It has only kindness. Only nurturing and love._";
	text2 = "_Or it did, before even this treasure was turned against us._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Who comes here?_";
	text1 = "_All. This place is a treasure of the Kranas, of the entire Ro. Even the jaded coast folk and the harsh Lithans and Dhagans come to enjoy its beauty._";
	text2 = "_Losing it would hurt us all deeply._";

begintalknode;
	state = 11;
	nextstate = -1;
	condition = 1;
	question = "_Why do people come here?_";
	text1 = "_So many purposes. The children are brought to walk the paths and learn our ways. The old come for comfort and healing. The druids come to meet and plan._";

begintalknode;
	state = 11;
	nextstate = 12;
	condition = 1;
	question = "_Why are you here?_";
	text1 = "_I have long looked after the groves. I walk from one to the other, looking for ways to help. Nobody asked. I walk alone._";
	text2 = "_I came to find a way to calm the vale. It is a treasure._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_How long have you done this?_";
	text1 = "She smiles. _It is impolite to ask a lady for her age._";
	text2 = "_I have walked these paths for over a hundred years. I no longer remember where I am from or when I started. The magic of the Kranas keeps me young and strong._";

begintalknode;
	state = 12;
	nextstate = -1;
	condition = 1;
	question = "_I was asked to calm the grove._";
	text1 = "_Yes. It is a decision that made many angry at our Raasa. The druids thought it was their job alone. Yet, they were failing at it._";
	text2 = "_Our Raasa did not know how much harm you would do, but he should have guessed._";
	code =
		if (gf(23,15) == 0)
			rs(2);
	break;
	
begintalknode;
	state = 10;
	nextstate = 13;
	condition = gf(24,14) > 0;
	question = "_What is wrong here?_";
	text1 = "_I don't know. We all thought that the Vale would stay calm and kind. Yet ... The heart of the path grew corrupted. It came on suddenly. For a time, the druids were all away. When they returned, the heart was angry._";

begintalknode;
	state = 13;
	nextstate = 14;
	condition = 1;
	question = "_What is the heart of the path?_";
	text1 = "_It is a tree, full of the power of nature. It is normally only touched by the druids, though sometimes outsiders get the honor._";
	text2 = "_Now we must stay away. It is angry._";

begintalknode;
	state = 14;
	nextstate = -1;
	condition = gf(24,11) == 0;
	question = "_Why is the Heart angry?_";
	text1 = "_We don't know. It has turned brown and twisted. It is sick, but it won't tolerate any of us approaching it. We can't bring ourselves to fight it, so we are at an impasse._";
	
begintalknode;
	state = 14;
	nextstate = -1;
	condition = gf(24,11) == 0;
	question = "_Are you going to fix it?_";
	text1 = "_I ... I can't. I admit it. I am not strong enough to subdue it, and it refuses my touch. I can do nothing but watch and make plans that are sure to fail._";

begintalknode;
	state = 14;
	nextstate = 15;
	condition = gf(24,11) == 0;
	question = "_Perhaps I can help._";
	text1 = "_Perhaps you can. Perhaps our poor, foolish Raasa was right. Maybe you can treat it while we can't. I am scared to say it, though._";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_What can I do?_";
	text1 = "_We think that it is actually sick. Afflicted. However, we can't get close enough to examine it. You might be able to pacify it and see what is wrong. You will need to be close to it, and it will be ... unwelcoming._";
	text2 = "";

begintalknode;
	state = 15;
	nextstate = -1;
	condition = 1;
	question = "_What are you afraid of?_";
	text1 = "_We don't want to put this most sacred treasure in Haven's hands. We are afraid of what you will do to the heart. Yet, we seem to have no choice._";

begintalknode;
	state = 10;
	nextstate = 16;
	condition = gf(24,11) > 0 && gf(24,12) == 0;
	question = "_I have calmed the Heart._ Tell the story.";
	text1 = "Proserpexa listens to the tale. Then she nods. _You have done well. I am grateful. I'm sure we all are. You have filled me with hope. Enough for me to take the next step in my journey._";

begintalknode;
	state = 16;
	nextstate = -1;
	condition = 1;
	question = "_Where are you going?_";
	text1 = "_I go to the heart of the rage. The most dangerous place, the peril the druids must face. I go to Tehrorman._";
	text2 = "She doesn't explain further. She doesn't pack up anything. She just turns and walks away to the north.";
	action = END_TALK;
	code =
		ro_faction(1);
		erase_char(2400);
		sf(24,15,1);
	break;
	
begintalknode;
	state = 10;
	nextstate = 17;
	condition = gf(24,12) > 0;
	question = "_I had to destroy the Heart._";
	text1 = "Proserpexa turns away, filled with grief. _Maybe ... Maybe this was necessary. I have to believe it was. Otherwise, I would have to aid ... No. I won't speak of it. I must be strong._";

begintalknode;
	state = 17;
	nextstate = -1;
	condition = 1;
	question = "_It attacked me. It was my right._";
	text1 = "_I have no choice but to believe you, though, deep down, I don't. Now our only hope is to go to the worst place, where our forest feels the deepest rage. Perhaps I can calm the forest before you do any more harm._";
	text2 = "She doesn't explain further. She doesn't pack up anything. She just turns and walks away to the north.";
	action = END_TALK;
	code =
		erase_char(2400);
		sf(24,15,1);
	break;

begintalknode;
	state = 17;
	nextstate = -1;
	condition = 1;
	question = "_I am sorry. It was too corrupted. I had no choice._";
	text1 = "_I ... I believe you. You are Haven. We have no choice but to submit. Now our only hope is to go to the worst place, where our forest feels the deepest rage. Perhaps I can calm the forest before you do any more harm._";
	text2 = "She doesn't explain further. She doesn't pack up anything. She just turns and walks away to the north.";
	action = END_TALK;
	code =
		erase_char(2400);
		sf(24,15,1);
	break;
	
//

begintalknode;
	tag = 40;
	state = -1;
	nextstate = 40;
	condition = 1;
	question = "Name";
	text1 = "You strike the diseased tree and knock some of the vines aside. This time, you see something different, something definitely wrong.";
	text2 = "There is a vicious iron blade sticking out of the trunk. Someone snuck into the path and attacked this mighty tree, leaving the blade in the wood. Since then, it has been driving the creature mad. You suspect that the attacker ended up among the bones at the thing's base.";
	text3 = "Of course, you could just destroy the tree. If you did, it won't attack anyone in the future. It is likely no friend to Haven.";
	
begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "Pull out the sword.";
	text1 = "You leap forward, pushing your way past the vines, and grab the blade with both hands. Then, as the thorns tear at you, you pull with all your might.";
	text2 = "The blade comes free, and you fall back. Instantly, the tree calms down. The vines stop flailing. They begin to turn green again. The sense of menace fades from the vale.";
	text3 = "You have reclaimed the Tranquility Path. The Ro will be very grateful.";
	action = END_TALK;
	code =
		set_attitude(2430,3);
		sf(24,11,1);
		ro_faction(1);
		violence(-2);
		clear_town(24);
		reward_give(38);
	break;
	
begintalknode;
	state = 40;
	nextstate = -1;
	condition = 1;
	question = "Just destroy the tree.";
	text1 = "There is no need to tolerate this sort of uncontrolled magic in one of your vassals. It is a mad beast. It corrupts the land. It tried to kill you. It needs to go.";
	text2 = "You press forward, ready to rid your lands of a mindless predator.";
	action = END_TALK;

	
//

begintalknode;
	tag = 70;
	state = -1;
	nextstate = 70;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

begintalknode;
	state = 70;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";


//

begintalknode;
	tag = 100;
	state = -1;
	nextstate = 100;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 100;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 130;
	state = -1;
	nextstate = 130;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 130;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";

//

begintalknode;
	tag = 160;
	state = -1;
	nextstate = 160;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 160;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
		
//

begintalknode;
	tag = 190;
	state = -1;
	nextstate = 190;
	condition = 1;
	question = "Name";
	text1 = ".";
	text2 = "";
	text5 = ".";
	action = INTRO;

begintalknode;
	state = 190;
	nextstate = -1;
	condition = 1;
	question = "__";
	text1 = ".";
	text2 = "";
				